<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page session="true"%>
<%@page import="java.util.*"%>
<%@page import="tr.com.argela.tap.mot.models.Project"%>
<%@page import="tr.com.argela.tap.mot.models.Module"%>
<%@page import="tr.com.argela.tap.mot.models.User"%>
<%@page import="tr.com.argela.tap.mot.dao.ProjectDao"%>
<%@page import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
   <%
     User user = (User)request.getSession().getAttribute("userObject");
     String name = user.getName();
     
%>
   
   <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" type="text/css" href="style/styles.css">
    </head>
    <body>
      	<h4 align="right"> <%=name%></h4>
      	<h5 align="right"><a href="logout.jsp">Log out</a></h5>
       <div  align="center"> <h1 align="center">MOT</h1><h5 align="center">Memory Of Testing</h5></div>
        
        <dıv  align="left">
        <table align="left">
            <tr><td>
	        <h4><a href="currentProjects.jsp">Current Projects</a></h4>
	    </td></tr>
	      <tr><td>
	      	<h4><a href="createProject.jsp">Create Project</a></h4>
	    </td></tr>
	       <tr><td>
	         <h4><a href="projectVersion.jsp">Create Project Version</a></h4>
	    </td></tr>
	       <tr><td>
	         <h4><a href="versions.jsp">Project Versions</a></h4>
	    </td></tr>
	        <tr><td>
	          <h4><a href="users.jsp">Users</a></h4>
	    </td></tr>
	        <tr><td>
	           <h4><a href="export.jsp">Export Document</a></h4>
	    </td></tr>
        </table>
        </dıv>
        <br><br><br>
    <dıv align="right" >
    
    <form action="ProjectServlet">
    
    <table border="3" align="center">
    <% 
//call db method



if(request.getParameter("id3")==null)
	response.sendRedirect("properties.jsp");


ProjectDao projectDao2 = new ProjectDao();

Project project = projectDao2.checkproject(Long.parseLong((String)request.getParameter("id3")));

%>
    <tr><th colspan="2"> Update Project </th></tr>
    <tr><td>Project Name: </td><td><input type="text" name="projectname" value="<%=project.getName()%>"></td></tr>
    <tr><td>Project Description: </td><td><input type="text" name="prodescription" value="<%=project.getDescription() %>"></td></tr>
    <tr><td colspan="2"><input  type="hidden" name="projectId" id="projectId" value="<%=project.getId()%>">
    <input  type="hidden" name="project" id="project" value="updateproject">
    <input type="submit" name="updateproject" value="Save">
    <input type="reset" name="cancel" value="Cancel">
    </td></tr>
    </table>
    </form>
    </dıv>
    </body>
    </html>